﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using Styx.Helpers;

namespace SwInYUtility
{
    internal static class Log
    {
        private static Color LogColour = Color.SpringGreen;
        private static string Name = "[SwInYUtility] [{0}] ";

        public enum eLogType
        {
            RareKiller,
            GuildInviter,
            Glue,
            LootFilter,
            General
        }

        private static string GetTypeString(eLogType LogString)
        {
            if (LogString == eLogType.GuildInviter) return "Guild Inviter";
            if (LogString == eLogType.RareKiller) return "Rare Killer";
            if (LogString == eLogType.Glue) return "Glue";
            if (LogString == eLogType.LootFilter) return "Loot Filter";

            return "";
        }

        public static void Write(string Value, params object[] args)
        {
            Value = string.Format(Value, args);

            Logging.Write(LogColour, Name.Replace("{0}", GetTypeString(eLogType.General)) + Value);
            Logging.WriteDebug(LogColour, Name.Replace("{0}", GetTypeString(eLogType.General)) + Value);

        }
        public static void Write(eLogType PluginType, string Value, params object[] args)
        {
            Value = string.Format(Value, args);

            Logging.Write(LogColour, Name.Replace("{0}", GetTypeString(PluginType)) + Value);
            Logging.WriteDebug(LogColour, Name.Replace("{0}", GetTypeString(PluginType)) + Value);
        }

        public static void WriteDebug(string Value, params object[] args)
        {
            Value = string.Format(Value, args);

            Logging.WriteDebug(LogColour, Name.Replace("{0}", GetTypeString(eLogType.General)) + Value);
        }

        public static void WriteDebug(eLogType PluginType, string Value, params object[] args)
        {
            Value = string.Format(Value, args);

            Logging.WriteDebug(LogColour, Name.Replace("{0}", GetTypeString(PluginType)) + Value);
        }

    }
}
